package org.arkeologgr.appening.service.json;

import javax.xml.bind.annotation.XmlRootElement;

import org.arkeologgr.appening.entity.Item;
import org.arkeologgr.appening.entity.Item.ItemSource;


@XmlRootElement
public class ItemJSON {
	

	public ItemJSON() {
	}
	
	public ItemJSON(Item item) {
		this.entityUri = item.getEntityUri();
		this.latitude = item.getLatitude();
		this.longitude = item.getLongitude();
		this.thumbUrl = item.getThumbUrl();
		this.title = item.getTitle();
		if (item.getCreator() != null) {
			this.creatorName = item.getCreator().getUserName();
		} else {
			this.creatorName = "";
		}
		this.commentCount = 0;
		this.setItemSource(item.getItemSource());
	}
	
	private String entityUri;
	
	private String title;
	
	private double latitude;
	
	private double longitude;
	
	private String thumbUrl;
	
	private String creatorName;

	private int commentCount;
	
	private ItemSource itemSource;
	
	public String getEntityUri() {
		return entityUri;
	}

	public void setEntityUri(String entityUri) {
		this.entityUri = entityUri;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public String getThumbUrl() {
		return thumbUrl;
	}

	public void setThumbUrl(String thumbUrl) {
		this.thumbUrl = thumbUrl;
	}

	public String getCreatorName() {
		return creatorName;
	}

	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}

	public void setCommentCount(int commentCount) {
		this.commentCount = commentCount;
	}

	public int getCommentCount() {
		return commentCount;
	}

	public void setItemSource(ItemSource itemSource) {
		this.itemSource = itemSource;
	}

	public ItemSource getItemSource() {
		return itemSource;
	}

}
